/*
 * Copyright (c) Jiandong.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

let int8 = new Int8Array(4);
let int32 = new Int32Array(int8.buffer, 0, 1);
let float32 = new Float32Array(int8.buffer, 0, 1);


export class NumberUtil {

  public static floatToIntBits(value: number): number {
    float32[0] = value;
    return int32[0] as number;
  }

  public static intBitsToFloat(value: number): number {
    int32[0] = value;
    return float32[0] as number;
  }
}
